home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / games / pupworld.swf / scripts / __Packages / Heroes / BaddyBox.as < prev    next >
Encoding:
Text File  |  2011-06-09  |  1.3 KB  |  41 lines

  1. class Heroes.BaddyBox extends Heroes.AnyBox
  2. {
  3.    var myBox;
  4.    function BaddyBox()
  5.    {
  6.       super();
  7.       if(this._parent._parent.facing == "right")
  8.       {
  9.          this.myBox = new Heroes.Box(this._x + this._parent._parent.x,this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2,this._width,this._height,this._width);
  10.       }
  11.       else
  12.       {
  13.          this.myBox = new Heroes.Box(this._parent._parent.x - this._x - this._width,- this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2,this._width,this._height,this._width);
  14.       }
  15.    }
  16.    function onEnterFrame()
  17.    {
  18.       if(this._parent._parent.facing == "right")
  19.       {
  20.          this.myBox.setLocation(this._x + this._parent._parent.x,this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2);
  21.       }
  22.       else
  23.       {
  24.          this.myBox.setLocation(this._parent._parent.x - this._x - this._width,- this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2);
  25.       }
  26.       this.myBox.setSize(this._width,this._height,this._width);
  27.    }
  28.    function isHitting(attackBox)
  29.    {
  30.       return this.myBox.isHitting(attackBox);
  31.    }
  32.    function isTouching(px, py, pz)
  33.    {
  34.       return this.myBox.isTouching(px,py,pz);
  35.    }
  36.    function toString()
  37.    {
  38.       return this.myBox.toString();
  39.    }
  40. }
  41.